<?php
namespace Home\Model;
use Think\Verify;
use Think\Model;
class AdminModel extends Model 
{
	public $tableName = 'admin';

	//获取日志条数
	public function signIn($arr)
	{
		//var_dump(1111);exit;

		$check = $arr['code'];
		$verify=new \Think\Verify();
        $res=$verify->check($check);


        if($res)
        {
			$admin['name'] = $arr['name'];
			$admin['pwd'] = $arr['password'];
			
			$userModel    = M($this->tableName);
			$userRes          = $userModel->where($admin)->limit(1)->select();
		
			if($userRes)
			{
				return $userRes;//登录成功
			}else
			{
				return 'err';//登录错误
			}
        }else
        {
        	return 'onEq';//验证码不正确
        }
	}


}